import { h,Component } from 'preact';
import PropTypes from 'prop-types';
import classNames from 'classnames';

class Badge extends Component {
	constructor(props) {
		super(props);
		this.state = {

		};
	}

	componentDidMount() {

	}

	render({ children,className,type,tag: Tag }) {
		return (
			<Tag className={classNames('badge',className, { [`badge-${type}`]: !!type })}>
				{children}
			</Tag>
		);
	}
}

Badge.propTypes = {
	children: PropTypes.node,
	tag: PropTypes.string
};

Badge.defaultProps={
	tag: 'a'
};

export default Badge;
